import request from '@/utils/request'

// 查询用量数据列表
export function getTerminalDosageList(query) {
  let baseUrl = '/datastatistics/terminalDbStatisticAnalysis/dosageTrend?location_nb=' + query.location_nb
  if(query.startTime !=null && query.startTime !=''){
    baseUrl += '&startTime=' + query.startTime
  }
  if(query.endTime !=null && query.endTime !=''){
    baseUrl += '&endTime=' + query.endTime
  }
  if(query.interval !=null && query.interval !=''){
    baseUrl += '&interval=' + query.interval
  }
  if(query.dataType !=null && query.dataType !=''){
    baseUrl += '&dataType=' + query.dataType
  }
  return request({
    // url: '/datastatistics/terminalDbStatisticAnalysis/dosageTrend?sheetsCode=' + query.sheetsCode + '&startTime=' + query.startTime + '&endTime=' + query.endTime + '&interval=' + query.interval+ '&dataType=' + query.dataType,
    url: baseUrl,
    method: 'get',
    // params: query
  })
}
// 获取分页数据
export function getPageList(query) {
  return request({
    // url: '/datastatistics/terminalDbStatisticAnalysis/dataTrendForPage?location_nb=' + query.location_nb + '&startTime=' + query.startTime + '&endTime=' + query.endTime + '&interval=' + query.interval+ '&dataType=' + query.dataType,
    url: '/datastatistics/terminalDbStatisticAnalysis/dataTrendForPage',
    method: 'get',
    params: query
  })
}
// 日数据统计
export function getReportByDay(query) {
  return request({
    url: '/datastatistics/terminalsdayfreezedb/getReportByDay',
    method: 'get',
    params: query
  })
}
// 月用量统计
export function getReportByMonth(query) {
  return request({
    url: '/datastatistics/terminalsmonfreezedb/getReportByMonth',
    method: 'get',
    params: query
  })
}

// 年用量统计
export function getReportByYear(query) {
  return request({
    url: '/datastatistics/terminalsmonfreezedb/getReportByYear',
    method: 'get',
    params: query
  })
}

// 时用量统计
export function getHourUsages(query) {
  return request({
    url: '/datastatistics/terminalsdayfreezedb/getHourUsages',
    method: 'get',
    params: query
  })
}

// 夜间小流对比
export function getMiniFlowComparison(query) {
  return request({
    url: '/datastatistics/terminalsdayfreezedb/getMiniFlowComparison',
    method: 'get',
    params: query
  })
}
// 压力监测
export function getPressureWatchList(query) {
  return request({
    url: '/datastatistics/terminalsdayfreezedb/getPressureWatchList',
    method: 'get',
    params: query
  })
}
// 区域树
export function listAreaTree() {
  return request({
    url: '/basedata/terminalsdb/listAreaTree',
    method: 'get'
  })
}
